Conventionally, the MPEG (Moving Picture Experts Group) standard has been used for compressing content data and transmitting or recording the compressed content data. For example, an MPEG2 data structure will be described with reference to FIGS. 1A to 1F. First, an upper layer of the MPEG2 data structure is constituted by a pack header area 101 in which a pack header is stored, and a packet area 102 which follows the pack header area 101 and in which packeted content data is stored, as shown in FIG. 1A.
The pack header area 101 forms a header of a pack 100 made up of the pack header area 101 and a plurality of packet areas 102. Specifically, the pack header area 101 is constituted by a pack start area 111 in which a pack start code is stored, an identification data area 112 in which an identification code “01” for identifying from MPEG1 is stored, an SCR area 113 in which a system time reference value (system clock reference) is stored, a multiplexing rate area 114 in which the bit rate of this stream is stored, a stuffing length area 115 in which a stuffing length indicating the length of stuffing data is stored, and a stuffing area 116 in which stuffing data is stored, as shown in FIG. 1B.
The first packet area 102 in which content data is stored is a PES (packet elementary stream) header. The first packet area 102 is constituted by a packet start code area 121 in which a leading part start code and stream ID of this packet area 102 are stored, a packet length area 122 in which the packet length of this packet area 102 is stored, an identification data area 123 in which an identification code “01” for identifying from MPEG1 is stored, a control area 124 in which a scrambling control flag, a control code and the like are stored, a PES header area 125 in which a PES header length is stored, a PTS area 126 in which PTS (presentation time stamp) is stored, a DTS area 127 in which DTS (decoding time stamp) is stored, an area 128 in which various data such as ESCR (elementary stream clock reference) are stored, a stuffing area 129 in which stuffing data is stored, and a packet data area 130 in which packeted content data is stored, as shown in FIGS. 1C and 1D.
A packet area 102 at a halfway part of the content data is constituted by a packet start code area 131 in which a leading part start code and stream ID of the packet are stored, a packet length area 132 in which the packet length is stored, and a packet data area 133 in which packeted content data is stored, as shown in FIG. 1E. The last packet area 102 of the content data is constituted by a packet start code area 141 in which a leading part start code and stream ID of the packet are stored, a packet length area 142 in which the packet length is stored, and a padding area 143 in which padding data is stored, as shown in FIG. 1F.
The stuffing data stored in the stuffing area 116 of the packet header area 101 has a variable length. Therefore, the positions of the leading part of the packet and the control area 124 in which the scrambling control flag and the like are stored are deviated, making it difficult to perform control at the time of data reproduction and the like.
When content data is recorded by using this MPEG2 system to a recording medium such as an optical disc on which divided sectors with a predetermined length are provided, if the last part of the content data ends immediately before a sector boundary, the padding data cannot be stored into the last packet.